package io.renren.modules.test.usecase.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.modules.test.usecase.entity.UseCaseLibrary;
import io.renren.modules.test.usecase.mapper.CaseLibraryMapper;
import io.renren.modules.test.usecase.service.CaseLibraryService;
import org.springframework.stereotype.Service;

/**
 * @author liyinuo
 * 关联表基本操作实现
 */
@Service
public class CaseLibraryServiceImpl extends ServiceImpl<CaseLibraryMapper, UseCaseLibrary> implements CaseLibraryService {

    @Override
    public Long selectLibraryByCase(Long id) {
        Long libraryId = this.getOne(new QueryWrapper<UseCaseLibrary>().eq("case_id", id)).getLibraryId();
        return libraryId;
    }
}
